package com.team11.server.service.admin;

import com.team11.server.mapper.Admin_InsertKc_Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
public class Admin_InsertKc_Service {
    @Autowired
    private Admin_InsertKc_Mapper admin_insertKc_mapper;
    //初始化
    public void InsertSk(){
        admin_insertKc_mapper.InsertSk();
    }
    //查询新增的skid
    public Integer SelNewSk(){
        return admin_insertKc_mapper.SelNewSk();
    }
    //查询课程是否存在
    public Integer SelHaveKc(HashMap<String,Object> map){
        String tN= (String) map.get("zRtName");
        String[] tArray=tN.split("-");
        String tNumber=tArray[0];
        map.put("tJobNumber",tNumber);
        return admin_insertKc_mapper.SelHaveKc(map);
    }
    //新增课程
    public void InsertKc(HashMap<String,Object> map){
        admin_insertKc_mapper.InsertKc(map);
    }
    //更新新增的上课表
    public void UpdateSk(HashMap<String,Object> map){
        admin_insertKc_mapper.UpdateSk(map);
    }
    //更新实训老师信息
    public void InsertSxT(HashMap<String,Object> map){
        String tN= (String) map.get("sxTeacher");
        String[] tArray=tN.split("-");
        String tNumber=tArray[0];
        map.put("tJobNumber",tNumber);
        admin_insertKc_mapper.InsertSxT(map);
    }


}
